--二选一数据选择器
--201841052073 叶佳豪
--**************引入库********************
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
--**************声明实体区*****************
ENTITY MUX2 IS										
	PORT(		SET				:IN std_logic;				--设置信号输入端口
				IN0,IN1				:IN std_logic;			--输入
				OUT0				:OUT std_logic			--输出
		);--没用到直接注释
END MUX2;
--***************结构体区****************		
ARCHITECTURE RUN OF MUX2 IS

BEGIN
	PROCESS(SET,IN0,IN1)
	BEGIN
		CASE SET IS
			WHEN '0' =>OUT0<= IN0;
			WHEN '1' =>OUT0<= IN1;
			WHEN 'Z' =>OUT0<= 'Z';
			WHEN OTHERS =>NULL;
		END CASE;
	END PROCESS;
end RUN;

--****************************************